             MODIFYING THE PEOPLES GENERAL MODGEN.DAT FILE
==========================================================================
	Instructions for using Fred Chlanda's PPEG & UPEG programs
	              with batch files from Redball
	       instructions by Redball, April 8, 2004
==========================================================================


CREDITS
-------
PPEG.EXE and UPEG.EXE are DOS based programs written by Fred Chlanda.  Fred made some of the earliest PeG utilities.  Additional utilities are available at his web site:

UNPACK.BAT & REPACK.BAT are DOS based BATCH files which use Freds programs. 


NOTE:  
-----
The latest version (3.01) of Carl-Johan Ankerstjerne's PANZER2.DAT Tool is a more powerful, Windows based DAT editor which will work with both MODGEN.DAT and PANZER2.DAT.  It is available here:
	Panzer2.dat-Tool v3.0.1 by Carl-Johan Ankerstjerne		
	http://pub131.ezboard.com/fjpspanzersfrm10



TO START
--------
1. Create a new folder in your main PeG folder;  Ill call it the S16 folder but it can be named anything you want.

2. Unzip the file CHANGEMODGEN.ZIP to the S16 folder.

3. If youve already unzipped CHANGEMODGEN.ZIP, simply copy or move the following files to the S16 folder:
	CONTENTSHEADER.TXT		(header file to be used with CONTENTS2.TXT)
	Modifying MODGEN.txt		(this file)
	LISTS16.BAT			(Redball's batch file to list all S16s)
	PPEG.EXE			(Fred's PEG DAT repacking program)
	REPACK.BAT			(Redball's batch file to run PPEG)
	UNPACK.BAT			(Redball's batch file to run UPEG)
	UPEG.EXE			(Fred's PEG DAT unpacking program)


4. Copy MODGEN.DAT to the S16 folder.  Leave this in your S16 folder as a backup in case you have difficulties at any step below.


UNPACK
------
1. Run UNPACK.BAT

2. This will create numerous files each of which has the ".S16" file extension.  

Youll have about 400+ S16 files if your MODGEN is the original version that came with PeG.  If youve downloaded a modified MODGEN, or changed it yourself, you will have a lot more S16 files.

These S16 files will take up 10 meg or more of disk space, but keep them:   Youll need them anytime you Repack the MODGEN file.  They are also very useful if you want to edit the S16 images (see "Background Information").

3. UNPACK will also create a file:  "CONTENTS1.TXT".  CONTENTS1.TXT is simply for your information



PACK
----
1. Copy the two new S16 files (INFOICN2.S16 & BUTTON2.S16) into the S16 folder.

2. Run LISTS16.BAT.

3. This will create a new file named "CONTENTS2.TXT" which contains an instruction header for REPACK and all of your S16 files in alphabetical order.  NOTE:  It is essential that the S16 files be listed alphabetically.

4. When LISTS16.BAT is finished the bottom of the screen will show the number of S16 files. Write down this number or remember it well.

5. Open CONTENTS2.TXT using any text editor (the Windows Notepad is best since it automatically saves files as plain text without any formatting codes).

6. On the fourth line replace the letters "NNN" with the number of S16 files PLUS ONE.    For example, if you have 412 S16 files this line MUST say 413.

7. Run REPACK.BAT.
	Repacking is making a file that is at least 8 megabytes; depending on the speed of your computer it may take 3 minutes or more to finish.  DON'T cancel the operation, just be patient.

8. When REPACK has finished you will have a very large file called NEWGEN.DAT located in your S16 folder.  

9. Delete the old MODGEN.DAT from your main PeG folder.

10. Copy NEWGEN.DAT to your main PeG folder.

11. rename NEWGEN.DAT to MODGEN.DAT

NOTE:  If you see "NEWGEN" rather than "NEWGEN.DAT" in the Windows Explorer it means you have the MS DOS file extensions hidden -- the ".DAT" is there but can't be seen.  (This is set via My Computer-Open-View-Options-View-Hide MS DOS Extensions.)

If that is the case then renaming NEWGEN (which is really NEWGEN.DAT) to MODGEN.DAT would result in a file named MODGEN.DAT.DAT.  Simply rename "NEWGEN" to "MODGEN"  and Explorer will provide the ".DAT" extension.

You are done!  You have a modified MODGEN.DAT file.



BACKGROUND INFORMATION
----------------------
The MODGEN.DAT file contains all the graphics for Peoples General except the map graphics.  It is roughly 8 megabytes or more and will contain 400+ separate S16 files.

Within Modgen there are separate files, each of which has the file extension ".S16".  These contain graphics specific to different things: user interface graphics and the unit icon graphics.  (Map graphics are also in S16 files but they are located in the MAP folder within your main PeG folder.)

S16 files are SSIs proprietary graphics storage format for 16 million color images (24 bit color depth).  They can be converted to bitmap images (BMP files) using Fred Chlandas PeGUtil and other programs.  The BMP files can then be edited with PaintShop Pro or other bitmap image editors.  After editing the BMP files can b reconverted to S16 files.


Be aware of two limitations with editing the MODGEN file:
 PPEG and UPEG can handle a MAXIMUM of 1000 S16 files in MODGEN.  This will not be a problem if you have the original SSI MODGEN file.  But some new (and very large) MODGEN files available for download do have more than 1000 S16 files.    As far as I know nothing will be damaged by using PPEG or UPEG on these large MODGEN files  they just wont work.  If that happens try one of the other Modgen editors described below.

 MODGEN can hold a large number of S16 files but only 400 unit icon files will be used by PeG at any one time.



OTHER MODGEN EDITORS
--------------------
Carl-Johan Ankerstjerne's PANZER2.DAT Tool is a more powerful, Windows based DAT editor which will work with both MODGEN.DAT and PANZER2.DAT.  It is available here:
	Panzer2.dat-Tool v3.0.1 by Carl-Johan Ankerstjerne		
	http://pub131.ezboard.com/fjpspanzersfrm10


Darth Stalin provided information on how to use Progis icon tool with PeG.  See his messages on the JPs Panzers PeG Forum:
http://pub131.ezboard.com/fjpspanzersfrm10.showMessage?topicID=824.topic

Luis Guzman created a console tool for use with Fred's UPEG and Lasse Hinze Jensen's .DAT modifying program.

These programs can work with a MODGEN.DAT that has more than 1000 S16 files in it.


